package com.iplant.wms.service.po.mss;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;

/**
 * 单位计算
 * 
 * @author ShrisJava
 *
 */
@DBBasePO(TableName ="mss_measureunit" ,CheckName = {"Code","SourceUnitID,MeasureUnitID"},
        Schemas = DBSchemas.WMS,CodeAuto = true,CodePrefix = "DWZH-")
public class MSSMeasureUnit extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    @DBCondition
    @DBField
    public int SourceUnitID = 0;
    @DBJoin(name = "Code",tableName = "mss_unit", tableAsName = "un1",
            Schemas = DBSchemas.Basic,MainTableField ="SourceUnitID")
    public String SourceUnitCode = "";
    @DBJoin(name = "Name",tableName = "mss_unit", tableAsName = "un1",
            Schemas = DBSchemas.Basic,MainTableField ="SourceUnitID")
    public String SourceUnitName = "";

    @DBCondition
    @DBField
    public int MeasureUnitID = 0;
    @DBJoin(name = "Code",tableName = "mss_unit", tableAsName = "un2",
            Schemas = DBSchemas.Basic,MainTableField ="MeasureUnitID")
    public String MeasureUnitCode = "";
    @DBJoin(name = "Name",tableName = "mss_unit", tableAsName = "un2",
            Schemas = DBSchemas.Basic,MainTableField ="MeasureUnitID")
    public String MeasureUnitName = "";

    /**
     * 转换系数：MeasureUnitID= Coefficient* SourceUnitID;
     */
    @DBField
    public float Coefficient = 1.0f;

    @JsonProperty("SourceUnitID")
    public int getSourceUnitID() {
        return SourceUnitID;
    }

    public void setSourceUnitID(int sourceUnitID) {
        SourceUnitID = sourceUnitID;
    }

    @JsonProperty("MeasureUnitID")
    public int getMeasureUnitID() {
        return MeasureUnitID;
    }

    public void setMeasureUnitID(int measureUnitID) {
        MeasureUnitID = measureUnitID;
    }

    @JsonProperty("Coefficient")
    public float getCoefficient() {
        return Coefficient;
    }

    public void setCoefficient(float coefficient) {
        Coefficient = coefficient;
    }

    @JsonProperty("SourceUnitCode")
    public String getSourceUnitCode() {
        return SourceUnitCode;
    }

    public void setSourceUnitCode(String sourceUnitCode) {
        SourceUnitCode = sourceUnitCode;
    }

    @JsonProperty("SourceUnitName")
    public String getSourceUnitName() {
        return SourceUnitName;
    }

    public void setSourceUnitName(String sourceUnitName) {
        SourceUnitName = sourceUnitName;
    }

    @JsonProperty("MeasureUnitCode")
    public String getMeasureUnitCode() {
        return MeasureUnitCode;
    }

    public void setMeasureUnitCode(String measureUnitCode) {
        MeasureUnitCode = measureUnitCode;
    }

    @JsonProperty("MeasureUnitName")
    public String getMeasureUnitName() {
        return MeasureUnitName;
    }

    public void setMeasureUnitName(String measureUnitName) {
        MeasureUnitName = measureUnitName;
    }



}
